/*-------------------------------------------------------------------------------------------------------------------------------------------
Program: Table4_infoeffects.do
*/
*version Stata/SE 17.0

clear all
set more off
macro drop _all

cd "/Volumes/GoogleDrive/My Drive/Documents/JMP/Work/Tables/tables_replication" 

use 				"merged_v0.31_replication.dta" , clear

encode session_id, gen(sess_id)
xtset sess_id

/*Generates income in '000's of rupees*/
gen inc = hh_inc/1000

/*I am creating a NoInfo treatment which is a control condition to add to the regression of amount sent on 
info conditions*/
replace norm = 0 if treatment==0
generate noinfo = 1 if norm==0
replace noinfo = 0 if norm !=0
replace norm60 = 0 if norm!=60
replace norm40 = 0 if norm!=40

label var 	amt_sent1	"Amount Sent"
label var	belief_oth1 "Belief: Majority's Sending"

label var 	noinfo 		"No Info"
label var   norm40      "Info 40"
label var   norm60      "Info 60"

label var 	inc			"Income (rupees in '000s)"			

/**** SPECIFICATION 3 *****/
/****GLS with session level random effects for amt_sent1, belief_oth1
and min_acc1 *****/

drop if female==. | work==. | age==.|educ ==. | inc==.| christian==.

foreach yvar in amt_sent1 belief_oth1 {

xtreg 			`yvar'  norm60 noinfo   , re vce(cluster sess_id)
est store 		`yvar'
estadd local SessionFE "No"

xtreg 			`yvar' 	norm60 noinfo   female work age educ inc christian  , re vce(cluster sess_id)
est store 		`yvar'_ctrls
estadd local SessionFE "No"

xtreg 			`yvar' 	norm60 noinfo   female work age educ inc christian i.sess_id , re vce(cluster sess_id)
estadd local SessionFE "Yes"
est store 		`yvar'_ctrls_fe
					}

											
esttab  amt_sent1 amt_sent1_ctrls amt_sent1_ctrls_fe belief_oth1 belief_oth1_ctrls belief_oth1_ctrls_fe   ///
		using "Table4_InformationTreatmentEffects/InfoEffects_unformatted.tex" ,  ///
		nonumbers  b(1) star(* 0.10 ** 0.05  *** 0.01) se(1) label  ///
		title(Effect of Information Condition on Behavior and Beliefs) replace 	///
		keep (norm60 noinfo female work age educ inc christian)  scalars("SessionFE") ///
		tex nonote ///
		addnotes("(1) GLS specification with session level random effects." ///
		             "(2) Standard errors in parentheses are clustered at the session level." ///
					 "(3) \sym{*} \(p<0.10\), \sym{**} \(p<0.05\), \sym{***} \(p<0.01\)" ///
					 "(4)  Info 40 is the reference category." ///
					 "(5) Employed is 1 if a participant reports having a paid job, and is 0 otherwise." ///
					 "(6) Income is measured as the monthly household income." ///
					 "(7) The reference group for Christians is Hindus and Muslims.")
		
			

					
							
	
	eststo clear
	
	

	
	log close 
	exit



								
			

					
							
	
	
	


